<?php
if (APPLICATION_ENV == 'production') {
    $files = array();
    foreach($this->JQuery()->getJavascriptFiles() as $k => $v) {
        if(preg_match('#custom_.*#', basename($v))) {
            $files[] = $v;
        }
    }
    $this->JQuery()->clearJavascriptFiles();
    foreach($files as $f) {
        $this->JQuery()->addJavascriptFile($f);
    }
    $this->JQuery()->addJavascriptFile(Ac_Util::getImageBaseUrl('/js/all.min.v-'.AC_VERSION.'.js'));
} else {
    //$this->JQuery()->addJavascriptFile(Ac_Util::getImageBaseUrl('/js/tipsy/jquery.tipsy.v-'.AC_VERSION.'.js'));
    $this->JQuery()->addJavascriptFile(Ac_Util::getImageBaseUrl('/js/script.v-'.AC_VERSION.'.js'));
}



$grid_size = (boolean) (string) $this->placeholder('grid-size');
if (!$grid_size) {
    $grid_size = 16;
} else {
    $grid_size = (string) $this->placeholder('grid-size');
}

Zend_Registry::set('grid-size', $grid_size);

if (APPLICATION_ENV == 'production') {
    $this->headLink()->prependStylesheet(Ac_Util::getImageBaseUrl('/css/mobile/all.v-'.AC_VERSION.'.css'));
} else {
    $this->headLink()->prependStylesheet(Ac_Util::getImageBaseUrl('/css/mobile/custom.v-'.AC_VERSION.'.css'));
    $this->headLink()->prependStylesheet(Ac_Util::getImageBaseUrl('/css/mobile/style.v-'.AC_VERSION.'.css'));
}

?><!doctype html>  

<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
  	<meta charset="utf-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<?php echo $this->headTitle() ?>
	<meta name="author" content="AsiaClassified.com - Easy, Free, Local">
	<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=4.0;">
	<link rel="shortcut icon" href="/favicon.ico">
	<link rel="apple-touch-icon" href="/apple-touch-icon.png">
        <meta name="Geography" content="Hong Kong">
        <meta name="city" content="Hong Kong">
        <meta name="State" content="Hong Kong">
        <meta name="country" content="Hong Kong">   
        <?php echo $this->headMeta() ?>
	<?php echo $this->headLink() ?> 
    <?php echo $this->headStyle() ?> 
    <script src="<?php echo Ac_Util::getImageBaseUrl('/js/modernizr-1.5.min.js')?>"></script>
  	<!--script src="js/libs/modernizr-1.6.min.js"></script-->
 
</head>

<body>
  <div id="container" class="index<?php if(Zend_Controller_Front::getInstance()->getRequest()->getModuleName()=="search") echo " serp"; if(Zend_Controller_Front::getInstance()->getRequest()->getModuleName()=="search" && $this->listing_number==0) echo " no_result"?>">
  <?php echo $this->Partial('mobile/header.phtml', 'default'); ?>
    
    
    
    <article>
    <?php echo $this->layout()->content; ?>
	</article>
    
   <?php echo $this->Partial('mobile/footer.phtml', 'default'); ?>
  </div> <!-- end of #container -->


  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
  <script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.2.js"%3E%3C/script%3E'))</script>
  
  
  <!-- scripts concatenated and minified via ant build script-->
  <script src="/js/plugins.js"></script>
  <script src="/js/script.js"></script>
  <!-- end concatenated and minified scripts-->
  
  
  <!--[if lt IE 7 ]>
    <script src="js/libs/dd_belatedpng.js"></script>
    <script> DD_belatedPNG.fix('img, .png_bg'); </script>
  <![endif]-->


  <?php echo $this->headScript() ?>
  <?php echo $this->JQuery() ?>
  <?php if (defined('GOOGLE_ANALYTICS_MOBILE')): ?>
  <!-- change the UA-XXXXX-X to be your site's ID -->
  <script>
    var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '<?php echo GOOGLE_ANALYTICS_MOBILE ?>']);
      _gaq.push(['_setDomainName', '.asiaclassified.com']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

  </script>
  <?php endif; ?>  
</body>
</html>